function testType(type) {
    if (typeof type != 'object') {
        return typeof type;
    }
    if (typeof type == 'null') {
        return null
    }
    let str = Object.prototype.toString.call(type);
    str = str.slice(8, str.length - 1);
    return str
}

console.log(testType(/ /));